<template>
    <el-table :data="data" max-height="520px">
      <el-table-column v-for="(item,index) in headerList"
                       :key="index"
                       :label="item"
                       :prop="item"
      ></el-table-column>
    </el-table>
</template>

<script>
    export default {
        name: "AfterExtract",
        data() {
            return {
                data: JSON.parse(sessionStorage.getItem('stuData')),
                headerList:[]
            };
        },
        created() {
            this.headerList = this.getHeaderList()
        },
        methods: {
            getHeaderList () {
                let  headerList = []

                if (this.data.length > 0 ) {
                    headerList = Object.keys(this.data[0])
                }
                return headerList
            }
        }
    }
</script>

<style scoped>

</style>
